/**
 *
 *
 *
 *
 *
 */

package qky.admin.modules.customer.service.impl;

import java.util.Arrays;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import qky.common.constant.GlobalConstant;
import qky.common.utils.Query;
import qky.admin.modules.customer.dao.UserDao;
import qky.admin.modules.customer.entity.UserEntity;
import qky.admin.modules.customer.service.UserService;
import qky.common.utils.PageUtils;

@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		String userStatus = params.get("userStatus").toString();
		IPage<UserEntity> page = this.page(
			new Query<UserEntity>().getPage(params),
			new QueryWrapper<UserEntity>().in("user_status", Arrays.asList(userStatus.split(",")))
				.apply(params.get(GlobalConstant.SQL_FILTER) != null, (String)params.get(GlobalConstant.SQL_FILTER))
		);
		return new PageUtils(page);
	}

}
